/*
 * @Author: xuxu12138 1718324422@qq.com
 * @Date: 2023-08-29 09:46:07
 * @LastEditors: xuxu12138 1718324422@qq.com
 * @LastEditTime: 2023-10-21 15:50:29
 * @FilePath: /things-admin/src/base/api/MaintenanceModelApi.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Result } from '@/base/Result';
import { request } from '@/base/Request';
import { MaintenanceModel } from '@/base/model/MaintenanceModel';
import qs from 'qs'

export function getMaintenanceModel(modelId: number) {
  return request.getArray(MaintenanceModel, `/api/maintenance-model/findByModelId/${modelId}`)
}

export function postMaintenanceModel(params: {
  modelId: number,
  descriptions: string,
  componentName: string,
  usageTime: number,
  warranty: number
}) {
  return request.post(MaintenanceModel, '/api/maintenance-model', qs.stringify(params))
}
export function putMaintenanceModel(params: {
  modelId: number,
  descriptions: string,
  componentName: string,
  usageTime: number,
  warranty: number,
  updated: string,
  created: string
}) {
  return request.put(MaintenanceModel, '/api/maintenance-model', qs.stringify(params))
}

export function delMaintenanceModel(id: number) {
  return request.delete(`/api/maintenance-model/${id}`)
}